#ifndef PAINTERAREA_H
#define PAINTERAREA_H

#include <QWidget>
#include <QPen>
#include <QBrush>
#include <QPainter>


class PainterArea : public QWidget
{
    Q_OBJECT
public:
    explicit PainterArea(QWidget *parent = nullptr);

    enum shape
    {
        Line, //直线
        Rectangle  //矩形
    };

    void setShape(shape); //设置形状
    void setPen(QPen);   //设置画笔
    void setBrush(QBrush); //设置画刷

    void paintEvent(QPaintEvent*); //重绘事件 , 系统自带的函数（斜体）
    void setfillrule(Qt::FillRule); //填充规则

signals:

private:
    shape shp;
    QPen pen;
    QBrush brsh;
    Qt::FillRule fillrle;

};

#endif // PAINTERAREA_H
